// 角色相关接口
import service from '@/api/common'


export default {
  getRoles(params) {
    const resp = service.get('/api/v1/rbac/role', { params: params })
    return resp
  },

  addRole(user) {
    const resp = service.post(`/api/v1/rbac/role`, user)
    console.log(resp)
    return resp
  },

  updateRole(user) {
    const resp = service.patch(`/api/v1/rbac/role/${user.id}`, user)
    console.log(resp)
    return resp
  },

  deleteRole(id) {
    const resp = service.delete(`/api/v1/rbac/role`, { 'data': { 'ids': [id] } })
    console.log(resp)
    return resp
  }
}
